﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupLink</title>

<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-size: large;
}
.style2 {
	border-style: solid;
	border-width: 1px;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupLink<span class="style1"> (since 3.8)</span></h2>
<p>Creates a label that displays an underlined clickable text. It inherits from
<a href="iuplabel.html">IupLabel</a>. </p>

<h3><a name="Creation">Creation</a></h3>

<pre>Ihandle* IupLink(const char *<strong>url</strong>, const <strong>char</strong> * title); [in C]
iup.link{[url = <strong>url</strong>: string], [title = <strong>title</strong>: string]} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
link(<strong>url</strong>, <strong>title</strong>) [in LED]</pre>
<p><strong>url</strong>: the destination address of the link. Can be any text. 
If <strong>IupHelp</strong> is used should be a valid URL. It can be NULL. It 
will set the URL attribute.<br><b>
  title</b>: Text to be shown on the link. It can be NULL. It will set the 
  TITLE attribute.</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p>Inherits all attributes and callbacks of the 
<a href="iuplabel.html">IupLabel</a>, 
but redefines a few attributes.</p>
  <p><a href="../attrib/iup_fgcolor.html">FGCOLOR</a>: Text color. Default: the 
	global attribute LINKFGCOLOR.</p>


<p><strong>URL</strong>: the 
default value is "YES".</p>


<h3><a name="Callbacks">Callbacks</a></h3>


<p><a href="../call/iup_action.html">ACTION</a>:
  Action generated when the link is activated.</p>

  
    
<pre>int function(Ihandle*<strong> ih</strong>, char *<strong>url</strong>); [in C]<br><strong>ih</strong>:action(<strong>url</strong>: string) -&gt; (<strong>ret</strong>: number) [in Lua]</pre>

    
<p class="info"><strong>ih</strong>:
  identifier of the element that activated the 
  event.<br>

    <strong>url</strong>: the destination address of the link.</p>

<p class="info"><u>Returns</u>: IUP_CLOSE will be processed. If returns 
IUP_DEFAULT or it is not defined, the <strong>IupHelp</strong> function will be called.</p>


<h3><a name="Notes">Notes</a></h3>
<p>When the cursor is over the text, it is changed to the HAND cursor.</p>
<p>If the callback is not defined the <strong>IupHelp</strong> function is 
called with the given URL.</p>
<p>The <strong>IupLabel</strong> callbacks BUTTON_CB, ENTERWINDOW_CB and 
LEAVEWINDOW_CB are used internally.</p>


<h3><a name="Examples">Examples</a></h3>
<p><a href="../../examples/">Browse for Example Files</a></p>

<div align="center">
  <center>
  <img src="images/iuplink.png" class="style2">
  </center>
</div>

<h3><a name="SeeAlso">See Also</a></h3>

<p><a href="iuplabel.html">IupLabel</a>, <a href="../func/iuphelp.html">IupHelp</a>.</p>

</body>

</html>
